package at.dcmspl;

import java.io.Serializable;
import javax.persistence.Embeddable;

/**
 * This is a Embeddable Class which represent the Primary Key of the DcmFile Entity Class
 * @author Hannes Stornig, Daniel Gosch
 */
@Embeddable
public class DcmFileCPK implements Serializable{
    private String name;
    private Long parentDcmQueueId;
    
    /**
     * no Args Constructor
     */
    public DcmFileCPK(){
    }
    
    /**
     * Constructor
     * @param name
     * @param parentDcmQueueId 
     */
    public DcmFileCPK(String name, Long parentDcmQueueId){
        this.name = name;
        this.parentDcmQueueId = parentDcmQueueId;
    }

    public String getName() {
        return name;
    }
    
    public void setName(String name){
        this.name = name;
    }

    public Long getParentDcmQueueId() {
        return parentDcmQueueId;
    }
    
    public void setParentDcmQueueId(Long parentDcmQueueId){
        this.parentDcmQueueId = parentDcmQueueId;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DcmFileCPK other = (DcmFileCPK) obj;
        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
            return false;
        }
        if (this.parentDcmQueueId != other.parentDcmQueueId && (this.parentDcmQueueId == null || !this.parentDcmQueueId.equals(other.parentDcmQueueId))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 79 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 79 * hash + (this.parentDcmQueueId != null ? this.parentDcmQueueId.hashCode() : 0);
        return hash;
    }
    
}

